package com.yzt.message.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.yzt.zhuju.network.entity.message.GroupUserInfo;
import com.yzt.zhuju.network.entity.sysConfig.ReportPhotoBean;
import com.yzt.message.R;
import com.yzt.plugin_imageloader.ImageLoadUtil;
import com.yzt.plugin_widget.RoundFImageView;

import org.jetbrains.annotations.NotNull;

/**
 * 作者：bobwang
 * 创建时间：2023-11-19 23:32:58
 * 描述：群详情-用户列表
 */
public class GroupInfoUserAdapter extends BaseQuickAdapter<GroupUserInfo, BaseViewHolder> {

    public GroupInfoUserAdapter() {
        super(R.layout.item_group_info_user_img);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, GroupUserInfo item) {
        RoundFImageView photoIv = holder.getView(R.id.photo_riv);
        if (item.getType() == -1) {
            photoIv.setImageResource(R.mipmap.icon_message_user_add);
        } else if (item.getType() == -2) {
            photoIv.setImageResource(R.mipmap.icon_message_user_del);
        } else {
            ImageLoadUtil.load(getContext(), item.getAvatar(), photoIv, R.mipmap.default_photo);
        }
        holder.setText(R.id.tv_user_name, item.getMemberAlias());
    }
}

